package day12;

/**
 * @author oldliu
 * @since 1.0
 */
public class Worker extends Thread {
    public Worker(String name){
        super(name);
    }
    @Override
    public void run() {
        while (true){
            System.out.println(this.getName()+"干活!!!!!!");
            System.out.println(this.getName()+"累了,歇一会");
            try {
                sleep(500);
                System.out.println(this.getName()+"睡到自然醒！");
            } catch (InterruptedException e) {
                e.printStackTrace();
                System.out.println(this.getName()+"被吵醒！");
            }
        }
    }
}
